package com.spring.oaassist.web.model;


public class BudgetData implements Comparable<BudgetData> {
	private String element_name;
	private String element;
	private String item;
	private String item_name;
	private String value;
	private Integer element_index;
	private Integer item_index;

	public String getElement_name() {
		return element_name;
	}

	public void setElement_name(String element_name) {
		this.element_name = element_name;
	}

	public String getElement() {
		return element;
	}

	public void setElement(String element) {
		this.element = element;
	}

	public String getItem() {
		return item;
	}

	public void setItem(String item) {
		this.item = item;
	}

	public String getItem_name() {
		return item_name;
	}

	public void setItem_name(String item_name) {
		this.item_name = item_name;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public Integer getElement_index() {
		return element_index;
	}

	public void setElement_index(Integer element_index) {
		this.element_index = element_index;
	}

	public Integer getItem_index() {
		return item_index;
	}

	public void setItem_index(Integer item_index) {
		this.item_index = item_index;
	}

	@Override
	public int compareTo(BudgetData o) {
		int i = 0;
		if (o != null) {
			if (this.getItem_index() > o.getItem_index()) {
				if(this.getElement_index() > o.getElement_index()){
					i = 1;
				}else if(this.getElement_index() == o.getElement_index()){
					i = 0;
				}else{
					i = -1;
				}
			} else if (this.getItem_index() == o.getItem_index()) {
				if(this.getElement_index() > o.getElement_index()){
					i = 1;
				}else if(this.getElement_index() == o.getElement_index()){
					i = 0;
				}else{
					i = -1;
				}
			}else{
				i = -1;
			}
		}
		return i;
	}
}
